package cn.jiyun.demo_users.junit;

import cn.jiyun.demo_users.DemoUsersApplication;
import cn.jiyun.demo_users.pojo.Users;
import cn.jiyun.demo_users.service.UsersService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.Date;

@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = {DemoUsersApplication.class})
public class UsersServiceTest {
    @Autowired
    private UsersService usersService;
    @Test
    public void testAddUsers(){
        Users users=new Users();
        users.setId(1);
        users.setNam("二狗");
        users.setPwd("111");
        users.setSex(1);
        users.setBirth(new Date());
        this.usersService.addUsers(users);
    }
}
